define(function(require, exports, module) {
    "use strict";
    var $ = require("$");
    require("slimscroll");
    require("./nav");
    require("./letter.js"); 
    exports.shortcutMenu=require("./menu");
    window.msg = require("dist/tips/init");
    if (navigator.userAgent.match(/iPad|iPod/i)) {
        window.onorientationchange = function() {
            if (window.orientation != 90) {
                if (!$.cookie('onorientationchange')) {
                    $.cookie('onorientationchange', www_version)
                    alert("竖屏 可能导致部分功能无法使用 请切换到横屏模式");
                };
            };
        }
    };


    var $document = $(document);
    $document.on('click', '[data-toggle^="class"]', function(e) { 
        e && e.preventDefault();
        var $this = $(e.target),
            $class, $target, $tmp, $classes, $targets; 
        !$this.data('toggle') && ($this = $this.closest('[data-toggle^="class"]'));
        $class = $this.data()['toggle'];
        $target = $this.data('target') || $this.attr('href');
        $class && ($tmp = $class.split(':')[1]) && ($classes = $tmp.split(','));
        $target && ($targets = $target.split(',')); 
        $targets && $targets.length && $.each($targets, function(index, value) {
            ($targets[index] != '#') && $($targets[index]).toggleClass($classes[index]);
        });
        $this.toggleClass('active');
    })


    $(function() {
        $('section.hidden-bsection').show();
        $('#loading_done').add('div.pageload-overlay').removeClass('show').hide();
        //ie bug
        var $ievbox = $('.ie11 .vbox').add('.ie .vbox');
        if ($ievbox.length > 0) {
            $ievbox.each(function() {
                $(this).height($(this).parent().height());
            });
            $(window).resize(function() {
                var $wh = $(window).height();
                $ievbox.each(function() {
                    $(this).height($wh - $(this).offset().top);
                });
            });
        }
        $('.no-touch .slim-scroll').each(function() {
            var $self = $(this),
                $data = $self.data(),
                $slimResize;
            $self.slimScroll($data);
            $(window).resize(function(e) {
                clearTimeout($slimResize);
                $slimResize = setTimeout(function() {
                    $self.slimScroll($data);
                }, 500);
            });

        });
    })

    if (window.release) {
        (function(a) {
            if (!a) return;
            var msg = "%c\u7ED9\u81EA\u5DF1\u7AD9\u5728\u66F4\u5927\u7684\u821E\u53F0\u4E00\u4E2A\u673A\u4F1A\uff1ahttp:\/\/www.weimob.com/\site/\jobs\/";
            if (window.chrome) {
                a.log("%c", "font-size:0;line-height:99px;padding:23px 90px;background:url(http://stc.weimob.com/img/www/index1/weimob-logo.png) no-repeat");
                a.log(msg, "color:#65bd77");
            } else {
                a.log(msg.replace(/%c/g, ''));
            }
        })(top.console);
    };
    $(document).on("click","[data-toggle='allLink']",function(){
        var $this=$(this);
        require.async("dist/link/init", function(link) {
           link.init(document,$this);
        });
    });




    var promotion = $("#promotion_first").val(), distribution= $("#distribution_first").val();

    $("#promotion").click(function(){
        if(modal1){
            $(".js_promotion").modal("show");
        }
    })

    $("#distribution").click(function(){
        if(modal2){
            $(".js_distribution").modal("show");
        }
    })
        
})
